﻿#region Using

using System;
using System.IO;
using System.Reflection;

using GameCommon.ServiceInterfaces;

#endregion

namespace GameCommon.Services
{
    internal class FileService : IFileService, IDisposable
    {
        private Stream stream;

        public void Dispose()
        {
            this.stream.Dispose();
        }

        public bool Exists(string path)
        {
            return File.Exists(path);
        }

        public Stream GetEmbeddedRessource(string path)
        {
            var assembly = Assembly.GetCallingAssembly();
            this.stream = assembly.GetManifestResourceStream(path);
            return this.stream;
        }
    }
}